﻿using A.M.ETO;
using A.M.Storage.I_Application;
using A.M.Storage.I_Infrastruecure;
using SqlSugar;
using System.Linq.Expressions;

namespace A.M.Storage.Application
{
    public class BaseServices<T,K>: IBaseServices<T,K> where T : class
    {
        private readonly IBaseRepository<T,K> base_Infrastruecure;
        public BaseServices(IBaseRepository<T, K> base_Infrastruecure)
        {
            this.base_Infrastruecure = base_Infrastruecure;
        }
        /// <summary>
        /// 单添加
        /// </summary>
        /// <param name="t">对象</param>
        /// <returns>受影响行数</returns>
        public int AddInfor(T t)
        {
            return base_Infrastruecure.AddInfor(t);
        }

        public Task<int> AddInfor_Async(T t)
        {
            return base_Infrastruecure.AddInfor_Async(t);
        }

        public int AddInfor_Batch(List<T> t)
        {
            return base_Infrastruecure.AddInfor_Batch(t);
        }

        public Task<int> AddInfor_Batch_Async(List<T> t)
        {
            return base_Infrastruecure.AddInfor_Batch_Async(t);
        }

        public int DelInfor(T t)
        {
            return base_Infrastruecure.DelInfor(t);
        }

        public Task<int> DelInfor_Async(T t)
        {
            return base_Infrastruecure.DelInfor_Async(t);
        }

        public int DelInfor_Batch(List<T> t)
        {
            return base_Infrastruecure.DelInfor_Batch(t);
        }

        public Task<int> DelInfor_Batch_Async(List<T> t)
        {
           return base_Infrastruecure.DelInfor_Batch_Async(t);
        }

        public bool ExecuteTrans(Action<ISqlSugarClient> action)
        {
            return base_Infrastruecure.ExecuteTrans(action);
        }

        public int UpdInfor(T t)
        {
            return base_Infrastruecure.UpdInfor(t);
        }

        public Task<int> UpdInfor_Async(T t)
        {
           return base_Infrastruecure.UpdInfor_Async(t);
        }

        public int UpdInfor_Batch(List<T> t)
        {
            return base_Infrastruecure.UpdInfor_Batch(t);
        }

        public Task<int> UpdInfor_Batch_Async(List<T> t)
        {
            return base_Infrastruecure.UpdInfor_Batch_Async(t);
        }

        /// <summary>
        /// 无条件查询
        /// </summary>
        /// <returns>List<T></returns>
        public List<T> GetShowInforOrder(Expression<Func<T, object>> orderInfor)
        {
            return base_Infrastruecure.GetShowInforOrder(orderInfor);
        }

        public List<T> GetShowInforOrder(Expression<Func<T, bool>> exception, Expression<Func<T, object>> orderInfor)
        {
            return base_Infrastruecure.GetShowInforOrder(exception,orderInfor);
        }

        public PageETO<T> GetShowInforOrder(int pageSize, int pageIndex, Expression<Func<T, object>> orderInfor)
        {
            return base_Infrastruecure.GetShowInforOrder(pageSize, pageIndex, orderInfor);
        }

        public PageETO<T> GetShowInforOrder(int pageSize, int pageIndex, Expression<Func<T, bool>> exception, Expression<Func<T, object>> orderInfor)
        {
            return base_Infrastruecure.GetShowInforOrder(pageSize, pageIndex, exception, orderInfor);
        }

        public T GetShowObj(Expression<Func<T, bool>> exception)
        {
            return base_Infrastruecure.GetShowObj(exception);
        }

        public Task<List<T>> GetShowInforAsyncOrder(Expression<Func<T, object>> orderInfor)
        {
            return base_Infrastruecure.GetShowInforAsyncOrder(orderInfor);
        }

        public Task<List<T>> GetShowInforAsyncOrder(Expression<Func<T, bool>> exception,Expression<Func<T,object>> orderInfor)
        {
            return base_Infrastruecure.GetShowInforAsyncOrder(exception, orderInfor);
        }

        public Task<PageETO<T>> GetShowInforAsyncOrder(int pageSize, int pageIndex, Expression<Func<T, object>> orderInfor)
        {
            return base_Infrastruecure.GetShowInforAsyncOrder(pageSize, pageIndex, orderInfor);
        }

        public Task<PageETO<T>> GetShowInforAsyncOrder(int pageSize, int pageIndex, Expression<Func<T, bool>> exception, Expression<Func<T, object>> orderInfor)
        {
            return base_Infrastruecure.GetShowInforAsyncOrder(pageSize, pageIndex, exception, orderInfor);
        }

        public Task<T> GetShowObjAsync(Expression<Func<T, bool>> exception)
        {
            return base_Infrastruecure.GetShowObjAsync(exception);
        }

        public ISugarQueryable<T> GetShowQueryableOrder(Expression<Func<T, object>> orderInfor)
        {
            return base_Infrastruecure.GetShowQueryableOrder(orderInfor);
        }

        public ISugarQueryable<T> GetShowQueryableOrder(Expression<Func<T, bool>> exception, Expression<Func<T, object>> orderInfor)
        {
            return base_Infrastruecure.GetShowQueryableOrder(exception, orderInfor);
        }

        public PageETO<T> GetShowQueryableOrder(int pageSize, int pageIndex, Expression<Func<T, object>> orderInfor)
        {
            return base_Infrastruecure.GetShowQueryableOrder(pageSize, pageIndex, orderInfor);
        }

        public PageETO<T> GetShowQueryableOrder(int pageSize, int pageIndex, Expression<Func<T, bool>> exception, Expression<Func<T, object>> orderInfor)
        {
            return base_Infrastruecure.GetShowQueryableOrder(pageSize, pageIndex, exception, orderInfor);
        }

        public async Task<ISugarQueryable<T>> GetShowQueryableAsyncOrder(Expression<Func<T, object>> orderInfor)
        {
            return await base_Infrastruecure.GetShowQueryableAsyncOrder(orderInfor);
        }

        public async Task<ISugarQueryable<T>> GetShowQueryableAsyncOrder(Expression<Func<T, bool>> exception, Expression<Func<T, object>> orderInfor)
        {
            return await base_Infrastruecure.GetShowQueryableAsyncOrder(exception, orderInfor);
        }

        public async Task<PageETO<T>> GetShowQueryableAsyncOrder(int pageSize, int pageIndex, Expression<Func<T, object>> orderInfor)
        {
            return await base_Infrastruecure.GetShowInforAsyncOrder(pageSize, pageIndex, orderInfor);
        }

        public async Task<PageETO<T>> GetShowQueryableAsyncOrder(int pageSize, int pageIndex, Expression<Func<T, bool>> exception, Expression<Func<T, object>> orderInfor)
        {
            return await base_Infrastruecure.GetShowInforAsyncOrder(pageSize, pageIndex, exception, orderInfor);
        }


        public void BeginTranInfor()
        {
            base_Infrastruecure.BeginTranInfor();
        }

        public void CommitTranInfor()
        {
            base_Infrastruecure.CommitTranInfor();
        }

        public void RollbackTranInfor()
        {
            base_Infrastruecure.RollbackTranInfor();
        }

        /// <summary>
        /// 无条件查询
        /// </summary>
        /// <returns>List<T></returns>
        public List<T> GetShowInfor()
        {
            return base_Infrastruecure.GetShowInfor();
        }

        public List<T> GetShowInfor(Expression<Func<T, bool>> exception)
        {
            return base_Infrastruecure.GetShowInfor(exception);
        }

        public PageETO<T> GetShowInfor(int pageSize, int pageIndex)
        {
            return base_Infrastruecure.GetShowInfor(pageSize, pageIndex);
        }

        public PageETO<T> GetShowInfor(int pageSize, int pageIndex, Expression<Func<T, bool>> exception)
        {
            return base_Infrastruecure.GetShowInfor(pageSize, pageIndex, exception);
        }


        public Task<List<T>> GetShowInforAsync()
        {
            return base_Infrastruecure.GetShowInforAsync();
        }

        public Task<List<T>> GetShowInforAsync(Expression<Func<T, bool>> exception)
        {
            return base_Infrastruecure.GetShowInforAsync(exception);
        }

        public Task<PageETO<T>> GetShowInforAsync(int pageSize, int pageIndex)
        {
            return base_Infrastruecure.GetShowInforAsync(pageSize, pageIndex);
        }

        public Task<PageETO<T>> GetShowInforAsync(int pageSize, int pageIndex, Expression<Func<T, bool>> exception)
        {
            return base_Infrastruecure.GetShowInforAsync(pageSize, pageIndex, exception);
        }


        public ISugarQueryable<T> GetShowQueryable()
        {
            return base_Infrastruecure.GetShowQueryable();
        }

        public ISugarQueryable<T> GetShowQueryable(Expression<Func<T, bool>> exception)
        {
            return base_Infrastruecure.GetShowQueryable(exception);
        }

        public PageETO<T> GetShowQueryable(int pageSize, int pageIndex)
        {
            return base_Infrastruecure.GetShowQueryable(pageSize, pageIndex);
        }

        public PageETO<T> GetShowQueryable(int pageSize, int pageIndex, Expression<Func<T, bool>> exception)
        {
            return base_Infrastruecure.GetShowQueryable(pageSize, pageIndex, exception);
        }

        public async Task<ISugarQueryable<T>> GetShowQueryableAsync()
        {
            return await base_Infrastruecure.GetShowQueryableAsync();
        }

        public async Task<ISugarQueryable<T>> GetShowQueryableAsync(Expression<Func<T, bool>> exception)
        {
            return await base_Infrastruecure.GetShowQueryableAsync(exception);
        }

        public async Task<PageETO<T>> GetShowQueryableAsync(int pageSize, int pageIndex)
        {
            return await base_Infrastruecure.GetShowInforAsync(pageSize, pageIndex);
        }

        public async Task<PageETO<T>> GetShowQueryableAsync(int pageSize, int pageIndex, Expression<Func<T, bool>> exception)
        {
            return await base_Infrastruecure.GetShowInforAsync(pageSize, pageIndex, exception);
        }

        public PageETO<T> GetPageShow(int pageSize, int pageIndex, List<T> values)
        {
            return base_Infrastruecure.GetPageShow(pageSize, pageIndex, values);
        }


    }
}
